<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxDao/IxSqlQueryBuilder.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_ix_sql_query_builder_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">IxSqlQueryBuilder.h</div>  </div>
</div>
<div class="contents">
<a href="_ix_sql_query_builder_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _IX_SQL_QUERY_BUILDER_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _IX_SQL_QUERY_BUILDER_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;<a class="code" href="_ix_data_member_x_8h.html" title="Common interface for a list of IxDataMember class properties registered into QxOrm context (for examp...">QxDataMember/IxDataMemberX.h</a>&gt;</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;<a class="code" href="_ix_sql_relation_8h.html" title="Common interface for all relationships defined between 2 classes (or between 2 tables in database)...">QxDao/IxSqlRelation.h</a>&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;<a class="code" href="_qx_soft_delete_8h.html" title="Soft delete (or logical delete) behavior to update a row into database (flag it as deleted) instead o...">QxDao/QxSoftDelete.h</a>&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;<a class="code" href="_qx_sql_relation_linked_8h.html" title="Hierarchy of relationships to build SQL query.">QxDao/QxSqlRelationLinked.h</a>&gt;</span>
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">namespace </span>qx {
<a name="l00053"></a>00053 <span class="keyword">namespace </span>dao {
<a name="l00054"></a>00054 <span class="keyword">namespace </span>detail {
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="keyword">class </span>IxDao_Helper;
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 } <span class="comment">// namespace detail</span>
<a name="l00059"></a>00059 } <span class="comment">// namespace dao</span>
<a name="l00060"></a>00060 } <span class="comment">// namespace qx</span>
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="keyword">namespace </span>qx {
<a name="l00063"></a>00063 
<a name="l00068"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html">00068</a> <span class="keyword">class </span><a class="code" href="_qx_macro_8h.html#aa569abe24f343fdc4ad5e12e156ba8a2">QX_DLL_EXPORT</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a>
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keyword">public</span>:
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a6b25e86997fb0a3b584a4a257a317d9f">00073</a>    <span class="keyword">typedef</span> QPair&lt;QString, QString&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a6b25e86997fb0a3b584a4a257a317d9f">type_id</a>;
<a name="l00074"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#af5e82ab4f4cbad93fb39278c266a4048">00074</a>    <span class="keyword">typedef</span> QHash&lt;type_id, void *&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#af5e82ab4f4cbad93fb39278c266a4048">type_ptr_by_id</a>;
<a name="l00075"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#acdfb5e8f920279a9ef9f9301600a4873">00075</a>    <span class="keyword">typedef</span> qx_shared_ptr&lt;type_ptr_by_id&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#acdfb5e8f920279a9ef9f9301600a4873">type_ptr_by_id_ptr</a>;
<a name="l00076"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a80160de13c06af74dbbca6bc1ba193dd">00076</a>    <span class="keyword">typedef</span> QList&lt;type_ptr_by_id_ptr&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a80160de13c06af74dbbca6bc1ba193dd">type_lst_ptr_by_id</a>;
<a name="l00077"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#aa34fe0af60ea684fd648066f61350293">00077</a>    <span class="keyword">typedef</span> qx_shared_ptr&lt;type_lst_ptr_by_id&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#aa34fe0af60ea684fd648066f61350293">type_lst_ptr_by_id_ptr</a>;
<a name="l00078"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae6f394db37640e4c26c45a523f23f850">00078</a>    <span class="keyword">typedef</span> <a class="code" href="classqx_1_1_qx_collection.html">QxCollection&lt;QString, IxDataMember *&gt;</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae6f394db37640e4c26c45a523f23f850">type_lst_data_member</a>;
<a name="l00079"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a5bdd43a1c6768a9e543d6315cff62675">00079</a>    <span class="keyword">typedef</span> qx_shared_ptr&lt;type_lst_data_member&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a5bdd43a1c6768a9e543d6315cff62675">type_lst_data_member_ptr</a>;
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="keyword">protected</span>:
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a61397d48b3b626e3145af0c2b513f009">00083</a>    <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a5bdd43a1c6768a9e543d6315cff62675">type_lst_data_member_ptr</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a61397d48b3b626e3145af0c2b513f009" title="Collection of &#39;IxDataMember&#39; to build sql query.">m_lstDataMemberPtr</a>;                      
<a name="l00084"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a978562c3c2d8d2ffc1fa14314da8330c">00084</a>    qx_shared_ptr&lt;IxSqlRelationX&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a978562c3c2d8d2ffc1fa14314da8330c" title="Collection of &#39;IxSqlRelation&#39; to build sql query.">m_lstSqlRelationPtr</a>;                
<a name="l00085"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2625ca17e1af66008eaaf5757c8a88ee">00085</a>    <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2625ca17e1af66008eaaf5757c8a88ee" title="Data member id for sql query.">m_pDataMemberId</a>;                                   
<a name="l00086"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a35378631e4173d5093547b8d9d2a850d">00086</a>    QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a35378631e4173d5093547b8d9d2a850d" title="Current sql query.">m_sSqlQuery</a>;                                              
<a name="l00087"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a00e1718be72aee31eb6480f0ac59a88e">00087</a>    QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a00e1718be72aee31eb6480f0ac59a88e" title="Sql table name of current object.">m_sTableName</a>;                                             
<a name="l00088"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a15db358ded43267be823b1b3e135c2e9">00088</a>    QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a15db358ded43267be823b1b3e135c2e9" title="Optimization : hash to retrieve sql query with relation.">m_sHashRelation</a>;                                          
<a name="l00089"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2b4f8dc9de57b8205ab6768e0e61047a">00089</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2b4f8dc9de57b8205ab6768e0e61047a" title="Recordset can return cartesian product =&gt; same id in multiple records.">m_bCartesianProduct</a>;                                         
<a name="l00090"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a606e3f8a7e2ff2bede31a3c29cbd7bdf">00090</a>    <a class="code" href="classqx_1_1_ix_sql_query_builder.html#aa34fe0af60ea684fd648066f61350293">type_lst_ptr_by_id_ptr</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a606e3f8a7e2ff2bede31a3c29cbd7bdf" title="Collection of id (and pointer associated) to avoid multiple fetch on same id (cartesian product)...">m_pIdX</a>;                                    
<a name="l00091"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87">00091</a>    <a class="code" href="classqx_1_1_qx_soft_delete.html" title="qx::QxSoftDelete : soft delete (or logical delete) behavior to update a row into database (flag it as...">QxSoftDelete</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a326633f89b911234490191680afefb87" title="Soft delete (or logical delete) behavior.">m_oSoftDelete</a>;                                       
<a name="l00092"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a1a3ae000bff62ae36085e0d945dd0d0e">00092</a>    QHash&lt;QString, QString&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a1a3ae000bff62ae36085e0d945dd0d0e" title="List of sql alias to replace into sql query.">m_lstSqlQueryAlias</a>;                       
<a name="l00093"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#abae3be97c65594fc99cbe895b1a983a3">00093</a>    <a class="code" href="classqx_1_1dao_1_1detail_1_1_ix_dao___helper.html" title="qx::dao::detail::IxDao_Helper : helper class to communicate with database">qx::dao::detail::IxDao_Helper</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#abae3be97c65594fc99cbe895b1a983a3" title="Pointer to the dao helper class associated to the builder.">m_pDaoHelper</a>;                     
<a name="l00094"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae598cd646e4c23698d69f4f00d0fdfc9">00094</a>    <a class="code" href="classqx_1_1_ix_data_member_x.html" title="qx::IxDataMemberX : common interface for a list of IxDataMember class properties registered into QxOr...">IxDataMemberX</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae598cd646e4c23698d69f4f00d0fdfc9" title="QxDataMemberX&lt;type_sql&gt; singleton reference.">m_pDataMemberX</a>;                                   
<a name="l00095"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a23e5160c5056c9138bad397900a06099">00095</a>    <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a23e5160c5056c9138bad397900a06099" title="Class initialisation finished.">m_bInitDone</a>;                                                 
<a name="l00096"></a>00096 
<a name="l00097"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a0f929a19d646cc2bf24c7a0e05f0b4b9">00097</a>    <span class="keyword">static</span> QHash&lt;QString, QString&gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a0f929a19d646cc2bf24c7a0e05f0b4b9" title="Store here all SQL queries generated by child classes.">m_lstSqlQuery</a>;                     
<a name="l00098"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a8c26bdd59fe34add5a72a6113489a11e">00098</a>    <span class="keyword">static</span> QHash&lt;QString, QHash&lt;QString, QString&gt; &gt; <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a8c26bdd59fe34add5a72a6113489a11e" title="Store here all SQL aliases generated by child classes.">m_lstSqlAlias</a>;    
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="keyword">public</span>:
<a name="l00101"></a>00101 
<a name="l00102"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#abb27024eb561bcaad020c79a964b9119">00102</a>    <a class="code" href="classqx_1_1_ix_sql_query_builder.html#abb27024eb561bcaad020c79a964b9119">IxSqlQueryBuilder</a>() : m_pDataMemberId(NULL), m_bCartesianProduct(false), m_pDaoHelper(NULL), m_pDataMemberX(NULL), m_bInitDone(false) { ; }
<a name="l00103"></a>00103    <span class="keyword">virtual</span> ~<a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a>() = 0;
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#acd246501a4c91e809ce4bed27f8c260c">00105</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_data_member_x.html" title="qx::IxDataMemberX : common interface for a list of IxDataMember class properties registered into QxOr...">IxDataMemberX</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#acd246501a4c91e809ce4bed27f8c260c">getDataMemberX</a>()<span class="keyword"> const                              </span>{ <span class="keywordflow">return</span> m_pDataMemberX; }
<a name="l00106"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#aaab65334a3a119e4bf80bc7bc7a4cead">00106</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_qx_collection.html">QxCollection&lt;QString, IxDataMember *&gt;</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#aaab65334a3a119e4bf80bc7bc7a4cead">getLstDataMember</a>()<span class="keyword"> const    </span>{ <span class="keywordflow">return</span> m_lstDataMemberPtr.get(); }
<a name="l00107"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#af379d397074eaab81620a8c4562312f0">00107</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_qx_collection.html" title="qx::QxCollection&lt;Key, Value&gt; : QxOrm container (keep insertion order + quick access by index + quick ...">IxSqlRelationX</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#af379d397074eaab81620a8c4562312f0">getLstRelation</a>()<span class="keyword"> const                             </span>{ <span class="keywordflow">return</span> m_lstSqlRelationPtr.get(); }
<a name="l00108"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#aab08cb826d85527c25a4dddb90cbb6b4">00108</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1dao_1_1detail_1_1_ix_dao___helper.html" title="qx::dao::detail::IxDao_Helper : helper class to communicate with database">qx::dao::detail::IxDao_Helper</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#aab08cb826d85527c25a4dddb90cbb6b4">getDaoHelper</a>()<span class="keyword"> const                </span>{ <span class="keywordflow">return</span> m_pDaoHelper; }
<a name="l00109"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#afbc23639be46a4251c08d5d1e295112d">00109</a>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#afbc23639be46a4251c08d5d1e295112d">setDaoHelper</a>(<a class="code" href="classqx_1_1dao_1_1detail_1_1_ix_dao___helper.html" title="qx::dao::detail::IxDao_Helper : helper class to communicate with database">qx::dao::detail::IxDao_Helper</a> * p)                { m_pDaoHelper = p; }
<a name="l00110"></a>00110 
<a name="l00111"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a54c1fb253e88b4f651a0f3a6cb5fe218">00111</a>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a54c1fb253e88b4f651a0f3a6cb5fe218">setHashRelation</a>(<span class="keyword">const</span> QString &amp; s)        { m_sHashRelation = s; }
<a name="l00112"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#ad852f0bbeffac3b30dff9a38a9112654">00112</a>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ad852f0bbeffac3b30dff9a38a9112654">setCartesianProduct</a>(<span class="keywordtype">bool</span> b)               { m_bCartesianProduct = b; }
<a name="l00113"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a583ccdd16fd2f463156e5fe95f502c90">00113</a>    <span class="keyword">inline</span> QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a583ccdd16fd2f463156e5fe95f502c90">getSqlQuery</a>()<span class="keyword"> const                    </span>{ <span class="keywordflow">return</span> m_sSqlQuery; }
<a name="l00114"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#af115e3dd9ab183aae0af08c23ffca7ff">00114</a>    <span class="keyword">inline</span> QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#af115e3dd9ab183aae0af08c23ffca7ff">getHashRelation</a>()<span class="keyword"> const                </span>{ <span class="keywordflow">return</span> m_sHashRelation; }
<a name="l00115"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#aea7e4a059d5a9d2b757b2a4db516225e">00115</a>    <span class="keyword">inline</span> QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#aea7e4a059d5a9d2b757b2a4db516225e">table</a>()<span class="keyword"> const                          </span>{ <span class="keywordflow">return</span> m_sTableName; }
<a name="l00116"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae2d7022c1f8f77775a27fd2929eec9c6">00116</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_qx_soft_delete.html" title="qx::QxSoftDelete : soft delete (or logical delete) behavior to update a row into database (flag it as...">QxSoftDelete</a> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ae2d7022c1f8f77775a27fd2929eec9c6">getSoftDelete</a>()<span class="keyword"> const             </span>{ <span class="keywordflow">return</span> m_oSoftDelete; }
<a name="l00117"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#abb23527b969bc8b21836c9aed9057754">00117</a>    <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#abb23527b969bc8b21836c9aed9057754">getCartesianProduct</a>()<span class="keyword"> const               </span>{ <span class="keywordflow">return</span> m_bCartesianProduct; }
<a name="l00118"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#ac566670f7cde10ab798b278cf599ceee">00118</a>    <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#ac566670f7cde10ab798b278cf599ceee">getDataCount</a>()<span class="keyword"> const                      </span>{ <span class="keywordflow">return</span> (m_lstDataMemberPtr ? m_lstDataMemberPtr-&gt;count() : 0); }
<a name="l00119"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2a53b5bb2b4a701d42c9dc656158bb80">00119</a>    <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a2a53b5bb2b4a701d42c9dc656158bb80">getRelationCount</a>()<span class="keyword"> const                  </span>{ <span class="keywordflow">return</span> (m_lstSqlRelationPtr ? m_lstSqlRelationPtr-&gt;count() : 0); }
<a name="l00120"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">00120</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a332df03965f1eb185a4a841933c3761f">getDataId</a>()<span class="keyword"> const               </span>{ <span class="keywordflow">return</span> m_pDataMemberId; }
<a name="l00121"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#af6c9bd4c50f0e285ed01fe0348175642">00121</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#af6c9bd4c50f0e285ed01fe0348175642">nextData</a>(<span class="keywordtype">long</span> &amp; l)<span class="keyword"> const        </span>{ <span class="keywordflow">if</span> ((! m_lstDataMemberPtr) || (l &lt; 0) || (l &gt;= m_lstDataMemberPtr-&gt;count())) { <span class="keywordflow">return</span> NULL; }; ++l; <span class="keywordflow">return</span> m_lstDataMemberPtr-&gt;getByIndex(l - 1); }
<a name="l00122"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a598a4ef56f71410b5570fb04bfd69232">00122</a>    <span class="keyword">inline</span> <a class="code" href="classqx_1_1_ix_sql_relation.html" title="qx::IxSqlRelation : common interface for all relationships defined between 2 classes (or between 2 ta...">IxSqlRelation</a> * <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a598a4ef56f71410b5570fb04bfd69232">nextRelation</a>(<span class="keywordtype">long</span> &amp; l)<span class="keyword"> const   </span>{ <span class="keywordflow">if</span> ((! m_lstSqlRelationPtr) || (l &lt; 0) || (l &gt;= m_lstSqlRelationPtr-&gt;count())) { <span class="keywordflow">return</span> NULL; }; ++l; <span class="keywordflow">return</span> m_lstSqlRelationPtr-&gt;getByIndex(l - 1); }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124    <span class="keywordtype">void</span> initIdX(<span class="keywordtype">long</span> lAllRelationCount);
<a name="l00125"></a>00125    <span class="keywordtype">bool</span> insertIdX(<span class="keywordtype">long</span> lIndex, <span class="keyword">const</span> QVariant &amp; idOwner, <span class="keyword">const</span> QVariant &amp; idData, <span class="keywordtype">void</span> * ptr);
<a name="l00126"></a>00126    <span class="keywordtype">void</span> * existIdX(<span class="keywordtype">long</span> lIndex, <span class="keyword">const</span> QVariant &amp; idOwner, <span class="keyword">const</span> QVariant &amp; idData);
<a name="l00127"></a>00127    <span class="keywordtype">void</span> setSqlQuery(<span class="keyword">const</span> QString &amp; sql, <span class="keyword">const</span> QString &amp; key = QString());
<a name="l00128"></a>00128    <span class="keywordtype">void</span> addSqlQueryAlias(<span class="keyword">const</span> QString &amp; sql, <span class="keyword">const</span> QString &amp; sqlAlias);
<a name="l00129"></a>00129    <span class="keywordtype">bool</span> getAddAutoIncrementIdToUpdateQuery() <span class="keyword">const</span>;
<a name="l00130"></a>00130    <span class="keywordtype">void</span> replaceSqlQueryAlias(QString &amp; sql) <span class="keyword">const</span>;
<a name="l00131"></a>00131    <span class="keywordtype">void</span> displaySqlQuery(<span class="keywordtype">int</span> time_ms = -1) <span class="keyword">const</span>;
<a name="l00132"></a>00132 
<a name="l00133"></a>00133    <span class="keyword">virtual</span> <span class="keywordtype">void</span> init();
<a name="l00134"></a>00134    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="group___qx_serialize.html#ga80162fe005f1f828a4589defaca4402f" title="qx::clone(const T &amp; obj) : return a boost smart-pointer (qx_shared_ptr&lt;T&gt;) of a new instance of type ...">clone</a>(<span class="keyword">const</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; other);
<a name="l00135"></a>00135    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; buildSql(<span class="keyword">const</span> QStringList &amp; columns = QStringList(), <a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">QxSqlRelationLinked</a> * pRelationX = NULL) = 0;
<a name="l00136"></a>00136 
<a name="l00137"></a><a class="code" href="classqx_1_1_ix_sql_query_builder.html#a33f483194d3612efeecebbb7aa5ebe07">00137</a>    <span class="keyword">static</span> QString <a class="code" href="classqx_1_1_ix_sql_query_builder.html#a33f483194d3612efeecebbb7aa5ebe07">addSqlCondition</a>(<span class="keyword">const</span> QString &amp; sql) { <span class="keywordflow">return</span> (sql.contains(<span class="stringliteral">&quot; WHERE &quot;</span>) ? <span class="stringliteral">&quot; AND &quot;</span> : <span class="stringliteral">&quot; WHERE &quot;</span>); }
<a name="l00138"></a>00138 
<a name="l00139"></a>00139    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_CreateTable(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00140"></a>00140    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_DeleteById(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keywordtype">bool</span> bSoftDelete);
<a name="l00141"></a>00141    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_Exist(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00142"></a>00142    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchAll(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00143"></a>00143    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchAll(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keyword">const</span> QStringList &amp; columns);
<a name="l00144"></a>00144    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchAll_WithRelation(<a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">qx::QxSqlRelationLinked</a> * pRelationX, QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00145"></a>00145    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchById(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00146"></a>00146    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchById(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keyword">const</span> QStringList &amp; columns);
<a name="l00147"></a>00147    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_FetchById_WithRelation(<a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">qx::QxSqlRelationLinked</a> * pRelationX, QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00148"></a>00148    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_Insert(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00149"></a>00149    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_Update(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00150"></a>00150    <span class="keyword">static</span> <span class="keywordtype">void</span> sql_Update(QString &amp; sql, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keyword">const</span> QStringList &amp; columns);
<a name="l00151"></a>00151 
<a name="l00152"></a>00152    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveOutput_FetchAll(<span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00153"></a>00153    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveOutput_FetchAll(<span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keyword">const</span> QStringList &amp; columns);
<a name="l00154"></a>00154    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveOutput_FetchAll_WithRelation(<a class="code" href="classqx_1_1_qx_sql_relation_linked.html" title="qx::QxSqlRelationLinked : hierarchy of relationships to build SQL query">qx::QxSqlRelationLinked</a> * pRelationX, <span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00155"></a>00155 
<a name="l00156"></a>00156    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveInput_Insert(<span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00157"></a>00157    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveInput_Update(<span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder);
<a name="l00158"></a>00158    <span class="keyword">static</span> <span class="keywordtype">void</span> resolveInput_Update(<span class="keywordtype">void</span> * t, QSqlQuery &amp; query, <a class="code" href="classqx_1_1_ix_sql_query_builder.html" title="qx::IxSqlQueryBuilder : common interface to build SQL queries to communicate with database...">IxSqlQueryBuilder</a> &amp; builder, <span class="keyword">const</span> QStringList &amp; columns);
<a name="l00159"></a>00159 
<a name="l00160"></a>00160 <span class="keyword">protected</span>:
<a name="l00161"></a>00161 
<a name="l00162"></a>00162    <span class="keywordtype">bool</span> verifyColumns(<span class="keyword">const</span> QStringList &amp; columns) <span class="keyword">const</span> BOOST_USED;
<a name="l00163"></a>00163 
<a name="l00164"></a>00164    <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * isValid_DataMember(<span class="keywordtype">long</span> lIndex) <span class="keyword">const</span>;
<a name="l00165"></a>00165    <a class="code" href="classqx_1_1_ix_data_member.html" title="qx::IxDataMember : common interface for all class properties registered into QxOrm context...">IxDataMember</a> * isValid_SqlRelation(<span class="keywordtype">long</span> lIndex) <span class="keyword">const</span>;
<a name="l00166"></a>00166 
<a name="l00167"></a>00167 };
<a name="l00168"></a>00168 
<a name="l00169"></a><a class="code" href="namespaceqx.html#adc9b7e24f5cb4073b847cef409b7a6be">00169</a> <span class="keyword">typedef</span> qx_shared_ptr&lt;IxSqlQueryBuilder&gt; <a class="code" href="namespaceqx.html#adc9b7e24f5cb4073b847cef409b7a6be">IxSqlQueryBuilder_ptr</a>;
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 } <span class="comment">// namespace qx</span>
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 <span class="preprocessor">#include &lt;<a class="code" href="_ix_dao___helper_8h.html" title="Helper class to communicate with database.">QxDao/IxDao_Helper.h</a>&gt;</span>
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 <span class="preprocessor">#endif // _IX_SQL_QUERY_BUILDER_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_ix_sql_query_builder_8h.html">IxSqlQueryBuilder.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:03 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
